<template>
  <div>
    <child1 @sendmsg1="getmsg"/>
    <div>
      父组件从子组件1接收到的数据为：{{mess}}
    </div>
    <child2 :sendmessage="mess"/>
  </div>
</template>

<script>
import child1 from "./components/child1"
import child2 from "./components/child2"
export default {
  name: 'App',
  components:{
    child1,
    child2,
  },
  data(){
    return{
      mess:""
    }
  },
  methods:{
    getmsg(temp){
      this.mess=temp
    }
  }
}
</script>

<style scoped>
div{
  text-align: center;
}
</style>